﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="AuthorityUserAdd.aspx.cs" Inherits="CG.OpSystemNew.Manage.webinfo.AuthorityUserAdd" %>

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
      <!-- #include file="~/include/header.html" -->
    <style>
        .form-horizontal .control-label {
            width: 20%;
            float: left;
            text-align: right;
        }

        .col-sm-3 {
            width: 80%;
            float: left;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server" class="form-horizontal">
        <section class="content">
            <div class="row">
                <div class="col-md-12">
                    <div class="box-body">
                        <div class="form-group">
                            <label class="col-sm-2 control-label" for="name">登陆账号：</label>
                            <div class="col-sm-3">
                                <asp:TextBox runat="server" MaxLength="30"
                                    ID="txtEjLoginName" CssClass="form-control" Width="300px" />
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label" for="name">用户名称：</label>
                            <div class="col-sm-3">
                                <asp:TextBox runat="server" MaxLength="20"
                                    ID="txtName" CssClass="form-control" Width="300px" />
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label" for="name">联系电话：</label>
                            <div class="col-sm-3">
                                <asp:TextBox runat="server" MaxLength="16"
                                    ID="txtMobile" CssClass="form-control" Width="300px" />
                            </div>
                        </div>
                        <div class="form-group" id="divPassword">
                            <label class="col-sm-2 control-label" for="name">密码：</label>
                            <div class="col-sm-3">
                                <asp:TextBox TextMode="Password" runat="server" MaxLength="16"
                                    ID="txtNewPass" CssClass="form-control" Width="300px" />
                            </div>
                        </div>
                        <div class="form-group" id="divtxtNewPassToo">
                            <label class="col-sm-2 control-label" for="name">确认密码：</label>
                            <div class="col-sm-3">
                                <asp:TextBox TextMode="Password" runat="server" MaxLength="16"
                                    ID="txtNewPassToo" CssClass="form-control" Width="300px" />
                            </div>
                        </div>
                    </div>
                    <div class="box-footer text-center">
                        <asp:Button ID="btnSave" Text="确定" runat="server" OnClick="btnSave_Click" CssClass="btn btn-primary" />
                        <button type="button" onclick="BMCW.closeAll();" class="btn" id="cancel">取 消</button>
                    </div>
                </div>
            </div>
        </section>
    </form>
     <!-- #include file="~/include/footer.html" -->
    <script type="text/javascript">
        $(document).ready(function () {
            var userId = <%=UserId%>;
            if (userId>0) {
                $("#divPassword").hide();
                $("#divtxtNewPassToo").hide();
            }
            //验证
            $("#form1").bootstrapValidator({
                submitHandler: function (valiadtor, loginForm, submitButton) {
                    valiadtor.defaultSubmit();
                },
                fields: {
                    txtEjLoginName: {
                        validators: {
                            notEmpty: {
                                message: '登陆账号不能为空'
                            },
                            stringLength: {
                                /*长度提示*/
                                min: 1,
                                max: 30,
                                message: '登陆账号长度必须在1到30之间'
                            }
                        }
                    },
                    txtName: {
                        validators: {
                            notEmpty: {
                                message: '用户名称不能为空'
                            },
                            stringLength: {
                                /*长度提示*/
                                min: 1,
                                max: 20,
                                message: '用户名称长度必须在1到20之间'
                            }
                        }
                    },
                    txtMobile: {
                        validators: {
                            notEmpty: {
                                message: '联系电话不能为空'
                            },
                            stringLength: {
                                /*长度提示*/
                                min: 1,
                                max: 11,
                                message: '联系电话长度必须在1到11之间'
                            }
                        }
                    },
                    txtNewPass: {
                        validators: {
                            notEmpty: {
                                message: '密码不能为空'
                            },
                            stringLength: {
                                /*长度提示*/
                                min: 6,
                                max: 10,
                                message: '密码长度必须在6到10之间'
                            }
                        }
                    },
                    txtNewPassToo: {
                        validators: {
                            notEmpty: {
                                message: '确认密码不能为空'
                            },
                            identical: {
                                field: 'txtNewPass',
                                message: '密码与确认密码不一致'
                            }
                        }
                    }
                }
        });
        });
        <%=Message %>
    </script>
</body>
</html>
